package com.example.aartest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity {
    private Button m_btnaar;
    private TextView tv;
    private final String sdcard = android.os.Environment.getExternalStorageDirectory().getAbsolutePath().toString();

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity);
        tv=this.findViewById(R.id.textView);
        m_btnaar = (Button)findViewById(R.id.btn_aar);
        m_btnaar.setOnClickListener((View.OnClickListener) new Btnlistener());
    }

    class Btnlistener implements View.OnClickListener {
        @Override
        public void onClick(View v) {
            tv.setText("Hello");

            Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
            //intent.setClass(目前的activity.this,目标activity.class)
            intent.setClass(com.example.aartest.MainActivity.this, com.example.myapplication.MainActivity.class);
            //开始跳转
            startActivity(intent);
        }
    }
}